import {connect} from 'react-redux'
import Calculation from '../component/calculation'
import {calculation} from '../action/calculation'

function mapStateToProps(initialState){
	return {
		input:initialState.calculation.input,
		time: initialState.calculation.time,
		expression:initialState.calculation.expression,
		error: initialState.calculation.error
	}
}
function mapDispatchToProps(dispatch){
	return {
		calculation: (data) => dispatch(calculation(data))
	}
}

const CalculationContainer = connect(
	mapStateToProps,
	mapDispatchToProps
	)(Calculation)

// console.log(Calculation)
export default CalculationContainer